package mq_wifi

import (
	"influxdbDemoData/influxdb"
	"influxdbDemoData/sysinit"
	"github.com/astaxie/beego"
)

var influxdbConnect *influxdb.Connect

func init() {
	beego.LoadAppConfig("ini", "./app.conf")
	sysinit.InitDatabase([]string{"mysql"})
	sysinit.InitLogs()

	//创建链接Influxdb
	iaddr := beego.AppConfig.String("influxdb::addr")
	ipassword := beego.AppConfig.String("influxdb::password")
	iusername := beego.AppConfig.String("influxdb::username")
	idbname := beego.AppConfig.String("influxdb::dbname")
	itimezone := beego.AppConfig.String("influxdb::timezone")

	influxdbConnect = influxdb.NewConnect(iaddr, iusername, ipassword, idbname, itimezone)
}
